package com.panshi.api.api;

import com.panshi.api.bean.ArticleBean;
import com.panshi.api.bean.UserCollectionBean;
import com.panshi.api.util.PageSizeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @author XiaoWangYa
 * @version 1.0
 * @date 2020/8/5 0005 下午 3:36
 */
@FeignClient("XiaoWangYa")
@Api("文章接口")
public interface ArticlePort {
    @PostMapping("/addArticle")
    @ResponseBody
    @ApiOperation("新增文章咨询")
    String addArticleInfo(@RequestBody ArticleBean articleBean);

    @PostMapping("/deleteArticleInfo/{id}")
    @ResponseBody
    @ApiOperation("删除文章咨询")
    String deleteArticleInfo(@PathVariable int id);

    @PostMapping("/queryArticleInfo")
    @ResponseBody
    @ApiOperation("查询所有文章咨询信息")
    List<ArticleBean> queryArticleInfo(@RequestBody PageSizeVO pageSizeBean);

    @PostMapping("/queryHotArticleInfo")
    @ResponseBody
    @ApiModelProperty("查询热门文章咨询")
    List<ArticleBean> queryHotArticleInfo(@RequestBody PageSizeVO pageSizeBean);

    @PostMapping("/queryNewArticleInfo")
    @ResponseBody
    @ApiModelProperty("查询最新文章内容")
    List<ArticleBean> queryNewArticleInfo(@RequestBody PageSizeVO pageSizeBean);

    @PostMapping("/queryArticleVerifiedInfo")
    @ResponseBody
    @ApiModelProperty("查询文章审核通过信息")
    PageSizeVO queryArticleVerifiedInfo (@RequestBody PageSizeVO yb_PageSize_VO);

    @PostMapping("/queryAssignArticleInfo/{aid}")
    @ResponseBody
    @ApiModelProperty("查询指定文章内容")
    ArticleBean queryAssignArticleInfo(@PathVariable int aid);

    @PostMapping("/userArticleCollection")
    @ResponseBody
    @ApiModelProperty("文章收藏")
    String addCollectSum(@RequestBody UserCollectionBean userCollectionBean);

    @PostMapping("/randomQueryArticle")
    @ResponseBody
    @ApiModelProperty("随机查询(专家推荐、大家都在看、其他看点、相关推荐")
    List<ArticleBean> randomQueryArticle(@RequestBody PageSizeVO pageSizeBean);

    @PostMapping("/updateAssignArticleInfo")
    @ResponseBody
    @ApiModelProperty("修改指定文章内容")
    String updateAssignArticleInfo(@RequestBody ArticleBean articleBean);
}
